//
//  KDFourthPostCell.m
//  WangJingApp
//
//  Created by 魏强 on 17/2/9.
//  Copyright © 2017年 KDTech. All rights reserved.
//

#import "KDFourthPostCell.h"
#import "KDUnitPerson.h"
@interface KDFourthPostCell ()
@property (weak, nonatomic) IBOutlet UIButton *selectBtn;
@property (weak, nonatomic) IBOutlet UILabel* nameLb;

@end
@implementation KDFourthPostCell
#pragma mark - 生命周期区
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    NSString *cellId =@"KDFourthPostCell";
    KDFourthPostCell *cell =[tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil)
    {
        cell =[[[NSBundle mainBundle]loadNibNamed:cellId owner:self options:nil]lastObject];
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    //    cell.contentView.backgroundColor = BackGroundColor;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (void)setModel:(KDUnitPerson *)model{
    _model = model;
    self.selectBtn.selected = model.select;
    //    KDLog(@"%d", model.select);
    self.nameLb.text = model.name;
}
- (IBAction)selectBtnClick:(UIButton *)sender {
    sender.selected = !sender.selected;
    if (_delegate && [_delegate respondsToSelector:@selector(fourthPostCell:selectBtnClick:)]) {
        [_delegate fourthPostCell:self selectBtnClick:sender];
    }
    
}



@end
